//
//  YXHomeTitleButton.swift
//  YXweibo
//
//  Created by AS on 5/14/16.
//  Copyright © 2016 AS. All rights reserved.
//

import UIKit

class YXHomeTitleButton: UIButton {

    override func layoutSubviews() {
        super.layoutSubviews()
        
        // 1.将文字的frame.origin.x = 0
        //        let labelFrame = titleLabel!.frame
        //        titleLabel?.frame = CGRect(x: 0, y: labelFrame.origin.y, width: labelFrame.width, height: labelFrame.height)

        titleLabel?.frame.origin.x = 0
        // 2.将图片的frame.origin.x设置为文字的宽度

        imageView?.frame.origin.x = (titleLabel?.frame.width)! + 3
        
    }
}
